// 加载登录注册组件
async function loadAuthComponent() {
    try {
        const response = await fetch('./components/auth/auth.html');
        const html = await response.text();
        document.getElementById('authModalContainer').innerHTML = html;
        // 重新初始化 AuthModal
        const authModalScript = document.createElement('script');
        authModalScript.type = 'module';
        authModalScript.textContent = `
            import authModal from './components/auth/auth.js';
            window.authModal = authModal;
        `;
        document.body.appendChild(authModalScript);
    } catch (error) {
        console.error('加载登录注册组件失败:', error);
    }
}

// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', () => {
    loadAuthComponent();
}); 